package com.essearch.service;

import com.essearch.model.Req;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 *  增删改查，TransportClient
 */
public interface ElasticsearchService {
    void insertById(String index, String type, String id, Map<String, Object> dataMap);

    void batchInsertById(String index, String type, Map<String, Map<String, Object>> idDataMap);

    void update(String index, String type, String id, Map<String, Object> dataMap);

    void deleteById(String index, String type, String id);

    /**
     * @param index 索引
     * @param total 查询条数
     * @return
     */
     List<String> queryAllByIndex(String index, int total);

    List<String> queryAllByReq(String index, Req req);

    void createIndex(String indexName, String indexType) throws IOException;
    //释放索引
    void recreateIndex(String indexName);

}
